<?php
require_once 'class/config_database.php';
require_once 'class/kamar.php';

$kamar_dao = new Kamar_Dao($host,$user,$pass,$dbnm);
$kamar  = new Kamar();

$kamar=$kamar_dao->get($_REQUEST['rooms_no']);
?>
<form method="POST" enctype="multipart/form-data">
<H3><center>Form Update Kamar :</center></h3>	
<table class="table table-striped" width="100%" border="0">
	<tr><td colspan="3">&nbsp </td></tr>
	<tr><td>Room's Name </td><td> : </td><td><input class="span4" type="text" name="rooms_name" value="<?php echo $kamar->rooms_name ?>"></td></tr>
	<tr><td>Price </td><td> : </td><td><input class="span4" name="price" type="text" value="<?php echo $kamar->price ?>"></td></tr>
	<tr><td>Facility</td><td> : </td><td><select class="span3" name="facility">
	<option value="Ekonomi">Ekonomi (Tempat Tidur, Lemari, Meja, Kamar Mandi Luar) </option>
	<option value="Bisnis">Bisnis (Tempat Tidur, Lemari, Meja, Parkir Mobil, TV, Kamar Mandi Dalam)</option>
	<option value="Eksekutif">Eksekutif (Tempat Tidur, Lemari, Meja, Parkir Mobil, TV, Kamar Mandi Dalam, AC, WiFi)</option>
	</select></td></tr>
	<tr><td>Address</td><td> : </td><td><textarea class="btn-block" name="address" rows="3"><?php echo $kamar->address ?></textarea></td></tr>
	<tr><td>Room Space (m2)</td><td> : </td><td><select class="span3" name="roomspace">
	<option value="Small"> < 10 </option>
	<option value="Medium">10 - 16</option>
	<option value="High"> > 16</option>
	</select></td></tr>
	<tr><td>Photo </td><td> : </td><td><img src="<?php echo "upload/".$kamar->room_figure ?>" width=200 ></td></tr>
	<tr><td>Ubah Photo </td><td> : </td><td><input size="40" type="file" name="fupload"></td></tr>
	<input type="hidden" name="photo2" value="<?php echo $kamar->room_figure ?>">
	<tr><td>Rubah Peta lokasi </td><td> : </td><td><font size="-2" color="red">Kosongkan bila tidak ingin melakukan perubahan..!</font><br><input class="span3" type="text" name="map_lock"></td></tr>
	<tr><td colspan="3"><center><font size="-2" color="red">Lokasi ditunjuk dengan tanda panah -></font><br><iframe width="425" height="350" frameborder="0" scrolling="no" marginheight="0" marginwidth="0" src="https://maps.google.co.id/maps?q=<?php echo $kamar->map_lock ?>&amp;num=1&amp;hl=id&amp;ie=UTF8&amp;t=m&amp;z=14&amp;ll=<?php echo $kamar->map_lock ?>&amp;output=embed"></iframe><br /><small><a href="https://maps.google.co.id/maps?q=<?php echo $kamar->map_lock ?>&amp;num=1&amp;hl=id&amp;ie=UTF8&amp;t=m&amp;z=14&amp;ll=<?php echo $kamar->map_lock ?>&amp;source=embed" style="color:#0000FF;text-align:left">Lihat Peta Lebih Besar</a></small></center></td></tr>
	<tr><td colspan="3"><center><input class="btn btn-primary" name="tombol_update_kamar" type="submit" value="Update">&nbsp <input class="btn btn-primary" type="button" value="Batal" onclick="self.history.back()"></center></td></tr>
</table></form>